package com.smh.a02PaiXuDemo2;

public class DiGui {
    public static void main(String[] args) {

        System.out.println(getSum(3));
        System.out.println(getJieCheng(5));


    }
    public static int getSum(int num){
        if (num==1){
            return 1;
        }
        return num+getSum(num-1);
    }

    public static int getJieCheng(int num){
        if (num==1){
            return 1;
        }
        return num * getJieCheng(num-1);
    }
}
